<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      *{
        padding: 0;
        margin: 0;
      }
    </style>
</head>
<body style="position: relative;">
  <div id="first" style="width: 100px;text-align: center;line-height: 100px; height: 100px;border-radius: 50%;border:1px solid red;display: inline-block;position: absolute;top:200px;left: 100px;">
  障碍物
  </div>
  <div id='car' draggable style="width: 50px;text-align: center;line-height: 200px; height: 200px;border:1px solid blue;display: inline-block;position: absolute;">货车</div>
</body>
</html>
<script src="./makeStyle.min.js"></script>
<!-- <script src="./jquery.min.js"></script> -->
<!-- <script>
  let C = $("#first");
  var Drag = document.getElementById('car');
  console.log(C,Drag)
  Drag.onmousedown = function(event) {
        var ev = event || window.event;
        event.stopPropagation();
        var disX = ev.clientX - Drag.offsetLeft;
        var disY = ev.clientY - Drag.offsetTop;
        document.onmousemove = function(event) {
          console.log(event)
            var ev = event || window.event;
            Drag.style.left = ev.clientX - disX + "px";
            Drag.style.top = ev.clientY - disY + "px";
            Drag.style.cursor = "move";
        };
    };
    Drag.onmouseup = function() {
        document.onmousemove = null;
        this.style.cursor = "default";
    };
    let imgStr  = 'https://images.wallpaperscraft.com/image/ball_mesh_relief_136928_2780x2780.jpg';
    function netSpeed(str){
      let startTime = Date.now(),xhr = new XMLHttpRequest();
      xhr.open('get',str,true);
      console.log(xhr,'xhr');
      xhr.onreadystatechange = function (e) {
        if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
          console.log(xhr.responseText)
        }
        let duration = (Date.now() - startTime);
        console.log(e,duration);
        let size = xhr.getResponseHeader("Content-Length") / 2708 / 2708; //  图片大小5M
        let speed = (size / duration).toFixed(2);
        console.log(speed + "mb/s当前网速 ");
    };
    xhr.send();
    }
    netSpeed(imgStr);
</script> -->
